/**
 * 根据共同的配置修改或者直接自定义个性化的配置
 */

import { commonProtoConfig } from '@/components/common/VisualizationComp/ChartConfig/common'

const { titleConfig } = commonProtoConfig

const THREE_GRADIENT = [
  {
    label: 'gradient1',
    value: ['#E31A1C', '#FBC94B', '#33A02C'],
  },
  {
    label: 'gradient2',
    value: ['#FF7F00', '#97B551', '#33A02C'],
  },
  {
    label: 'gradient3',
    value: ['#74C376', '#7BCCC4', '#1F78B4'],
  },
  {
    label: 'gradient4',
    value: ['#FFED6F', '#B3DE69', '#0298D8'],
  },
  {
    label: 'gradient5',
    value: ['#929FFF', '#5C6CE8', '#1D2C9F'],
  },
  {
    label: 'gradient6',
    value: ['#FDAD6B', '#F06912', '#A51516'],
  },
]

export const protoConfig = [
  {
    label: '',
    type: 'property',
    children: [
      ...titleConfig,
      {
        type: 'input',
        label: '标签',
        value: '',
        name: 'gaugeTitle',
        props: {
          placeholder: '请填写标签内容',
          maxLength: 50,
        },
      },
      {
        type: 'simpleColumnSelect',
        label: '描述字段',
        name: 'gaugeContentField',
        defaultValue: null,
        props: {
          placeholder: '请选择',
        },
      },
      {
        type: 'inputNumber',
        label: '描述字段大小',
        name: 'gaugeContentFieldSize',
        defaultValue: 24,
        props: {
          placeholder: '24',
        },
      },
      {
        type: 'inputNumber',
        label: '起始值',
        name: 'startValue',
        props: {
          dependentField: 'valueKey', // 获取某个字段统计的最大和最小值
          type: 'COLUMN_STAT_MIN',
        },
      },
      {
        type: 'inputNumber',
        label: '终止值',
        name: 'endValue',
        props: {
          dependentField: 'valueKey', // 获取某个字段统计的最大和最小值
          type: 'COLUMN_STAT_MAX',
        },
      },
      {
        type: 'themeColorPicker',
        label: '主题色',
        name: 'colors',
        defaultValue: THREE_GRADIENT[0].value,
        props: {
          options: THREE_GRADIENT,
        },
      },
    ],
  },
]
/**
 * 图表渲染的默认配置
 */
export const defaultOptions = {}
